package java8_26;

/**
 * @author oldliu
 * @since 1.0
 */
public class Mouse {
    private String name;
    private int strength;



    //boolean
    private boolean alive;//是否活着

    public boolean isAlive() {
        return alive;
    }

    public void setAlive(boolean alive) {
        this.alive = alive;
    }

    public String name(){
        return name;
    }
    public int strength(){
        return strength;
    }
    public void setStrength(int i){
        strength=i;
    }
    public Mouse(String name,int strength){
        this.name=name;
        this.strength=strength;
    }
    public void mouse(){
        System.out.println("这只老鼠叫"+name+",体力有"+strength);
    }
    public void run(Cat c){
        System.out.println(name+"逃过了"+c.name()+"的追杀，体力减20为"+(strength-20));
        System.out.println(c.name()+"气急败坏，乱跑乱撞体力减20为"+(c.strength()-20));
    }
}
